projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
08393a6
)
headerbar: Avoid allocating 0 visible children
author
Timm Bäder
<mail@baedert.org>
Mon, 28 Aug 2017 09:07:35 +0000
(11:07 +0200)
committer
Timm Bäder
<mail@baedert.org>
Mon, 28 Aug 2017 09:17:47 +0000
(11:17 +0200)
Ths avoids doing a bunch of work as well as passing 0 to g_alloca which
is undefined.
gtk/gtkheaderbar.c
patch
|
blob
|
history
diff --git
a/gtk/gtkheaderbar.c
b/gtk/gtkheaderbar.c
index 5b8ca74abd770ca17707e6cb0866b75a52f864f6..bfaf41bbc2fe475b60c8257f4ef9966667514640 100644
(file)
--- a/
gtk/gtkheaderbar.c
+++ b/
gtk/gtkheaderbar.c
@@
-932,6
+932,10
@@
gtk_header_bar_size_allocate (GtkWidget *widget,
direction = gtk_widget_get_direction (widget);
nvis_children = count_visible_children (bar);
+
+ if (nvis_children == 0)
+ return;
+
sizes = g_newa (GtkRequestedSize, nvis_children);
width = allocation->width - nvis_children * priv->spacing;